#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
typedef long long ll;
const int MAXN=1e7+9;
bool is_prime[MAXN];
int prime[MAXN], p_cnt;
int mu[MAXN];
ll sum[MAXN];
void Mobi() {
	memset(is_prime, 1, sizeof(is_prime));
	p_cnt=0;
	mu[1]=1;
	sum[1]=0;
	is_prime[1]=false;
	for (int i=2; i<MAXN; ++i) {
		if (is_prime[i]) {
			prime[p_cnt++]=i;
			mu[i]=-1;
			sum[i]=1;
		}
		for (int j=0; j<p_cnt&&i*prime[j]<MAXN; ++j) {
			is_prime[i*prime[j]]=false;
			if (i%prime[j]==0) {
				mu[i*prime[j]]=0;
				sum[i*prime[j]]=mu[i];
				break;
			}
			else {
				mu[i*prime[j]]=-mu[i];
				sum[i*prime[j]]=mu[i]-sum[i];
			}
		}
	}
} 
int main() {
	Mobi();
	ll n;
	ll ans=0;
	scanf("%lld", &n);
	for (int i=1; i<=n; ++i) {
		ans+=sum[i]*(n/i)*(n/i);
	}
	printf("%lld\n", ans);
	return 0;
}
